package encryption;

public class TanXin {

	public static void main(String[] args) {
		String str = sub(2,"15735896");
		System.out.println(str);
	}
	public static String sub(int x,String num) {
		String tNum = num;
		boolean has = false;
		for(int j=0;j<x;j++) {
			for(int i=0;i<num.length()-1;i++) {
				if(tNum.charAt(i)>tNum.charAt(i+1)) {
					tNum = tNum.substring(0, i)+tNum.substring(i+1);
					has = true;
					break;
				}
			}
			if(!has) {
				tNum = tNum.substring(0, tNum.length());
			}
		}
		return tNum;
	}
	
}
